import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户',
    align: "center",
    dataIndex: 'userId'
  },
  {
    title: '用户手机号',
    align: "center",
    dataIndex: 'userPhone'
  },
  {
    title: '订单号',
    align: "center",
    dataIndex: 'orderNo'
  },
  {
    title: '商户号',
    align: "center",
    dataIndex: 'mchno'
  },
  {
    title: '应用id',
    align: "center",
    dataIndex: 'appId'
  },
  {
    title: '支付方式',
    align: "center",
    dataIndex: 'wayCode_dictText'
  },
  {
    title: '支付金额(分)',
    align: "center",
    dataIndex: 'amount'
  },
  {
    title: '客户端ip',
    align: "center",
    dataIndex: 'clientIp'
  },
  {
    title: '订单标题',
    align: "center",
    dataIndex: 'subject'
  },
  {
    title: '订单描述',
    align: "center",
    dataIndex: 'body'
  },
  {
    title: '失效时间',
    align: "center",
    dataIndex: 'expiredTime'
  },
  {
    title: '渠道参数',
    align: "center",
    dataIndex: 'channelExtra'
  },
  {
    title: '分账模式',
    align: "center",
    dataIndex: 'divisionMode_dictText'
  },
  {
    title: '扩展参数',
    align: "center",
    dataIndex: 'extParam'
  },
  {
    title: '请求时间',
    align: "center",
    dataIndex: 'reqTime'
  },
  {
    title: '签名',
    align: "center",
    dataIndex: 'sign'
  },
  {
    title: '签名类型',
    align: "center",
    dataIndex: 'signType_dictText'
  },
  {
    title: '异步通知地址',
    align: "center",
    dataIndex: 'notifyUrl'
  },
  {
    title: '跳转通知地址',
    align: "center",
    dataIndex: 'returnUrl'
  },
  {
    title: '订单状态',
    align: "center",
    dataIndex: 'orderState_dictText'
  },
  {
    title: '支付数据类型',
    align: "center",
    dataIndex: 'payDataType'
  },
  {
    title: '发起支付数据',
    align: "center",
    dataIndex: 'payData'
  },
  {
    title: '渠道错误码',
    align: "center",
    dataIndex: 'errCode'
  },
  {
    title: '渠道错误描述',
    align: "center",
    dataIndex: 'errMsg'
  },
  {
    title: '支付成功时间',
    align: "center",
    dataIndex: 'successTime'
  },
  {
    title: '业务类型',
    align: "center",
    dataIndex: 'bizType_dictText'
  },
  {
    title: '业务数据',
    align: "center",
    dataIndex: 'bizDate'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "用户手机号",
    field: 'userPhone',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "订单号",
    field: 'orderNo',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "商户号",
    field: 'mchno',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "应用id",
    field: 'appId',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "支付方式",
    field: 'wayCode',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "way_code"
    },
    //colProps: {span: 6},
  },
  {
    label: "分账模式",
    field: 'divisionMode',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "division_mode"
    },
    //colProps: {span: 6},
  },
  {
    label: "签名类型",
    field: 'signType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "order_sign_type"
    },
    //colProps: {span: 6},
  },
  {
    label: "订单状态",
    field: 'orderState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "order_state"
    },
    //colProps: {span: 6},
  },
  {
    label: "业务类型",
    field: 'bizType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "order_biz_type"
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '用户手机号',
    field: 'userPhone',
    component: 'Input',
  },
  {
    label: '订单号',
    field: 'orderNo',
    component: 'Input',
  },
  {
    label: '商户号',
    field: 'mchno',
    component: 'Input',
  },
  {
    label: '应用id',
    field: 'appId',
    component: 'Input',
  },
  {
    label: '支付方式',
    field: 'wayCode',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "way_code"
    },
  },
  {
    label: '支付金额(分)',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '客户端ip',
    field: 'clientIp',
    component: 'Input',
  },
  {
    label: '订单标题',
    field: 'subject',
    component: 'Input',
  },
  {
    label: '订单描述',
    field: 'body',
    component: 'Input',
  },
  {
    label: '失效时间',
    field: 'expiredTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '渠道参数',
    field: 'channelExtra',
    component: 'Input',
  },
  {
    label: '分账模式',
    field: 'divisionMode',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "division_mode"
    },
  },
  {
    label: '扩展参数',
    field: 'extParam',
    component: 'Input',
  },
  {
    label: '请求时间',
    field: 'reqTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '签名',
    field: 'sign',
    component: 'Input',
  },
  {
    label: '签名类型',
    field: 'signType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "order_sign_type"
    },
  },
  {
    label: '异步通知地址',
    field: 'notifyUrl',
    component: 'Input',
  },
  {
    label: '跳转通知地址',
    field: 'returnUrl',
    component: 'Input',
  },
  {
    label: '订单状态',
    field: 'orderState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "order_state"
    },
  },
  {
    label: '支付数据类型',
    field: 'payDataType',
    component: 'Input',
  },
  {
    label: '发起支付数据',
    field: 'payData',
    component: 'Input',
  },
  {
    label: '渠道错误码',
    field: 'errCode',
    component: 'Input',
  },
  {
    label: '渠道错误描述',
    field: 'errMsg',
    component: 'Input',
  },
  {
    label: '支付成功时间',
    field: 'successTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '业务类型',
    field: 'bizType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "order_biz_type"
    },
  },
  {
    label: '业务数据',
    field: 'bizDate',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  userId: {title: '用户',order: 0,view: 'text', type: 'string',},
  userPhone: {title: '用户手机号',order: 1,view: 'text', type: 'string',},
  orderNo: {title: '订单号',order: 2,view: 'text', type: 'string',},
  mchno: {title: '商户号',order: 3,view: 'text', type: 'string',},
  appId: {title: '应用id',order: 4,view: 'text', type: 'string',},
  wayCode: {title: '支付方式',order: 5,view: 'list', type: 'string',dictCode: 'way_code',},
  amount: {title: '支付金额(分)',order: 6,view: 'number', type: 'number',},
  clientIp: {title: '客户端ip',order: 7,view: 'text', type: 'string',},
  subject: {title: '订单标题',order: 8,view: 'text', type: 'string',},
  body: {title: '订单描述',order: 9,view: 'text', type: 'string',},
  expiredTime: {title: '失效时间',order: 10,view: 'datetime', type: 'string',},
  channelExtra: {title: '渠道参数',order: 11,view: 'text', type: 'string',},
  divisionMode: {title: '分账模式',order: 12,view: 'list', type: 'string',dictCode: 'division_mode',},
  extParam: {title: '扩展参数',order: 13,view: 'text', type: 'string',},
  reqTime: {title: '请求时间',order: 14,view: 'datetime', type: 'string',},
  sign: {title: '签名',order: 15,view: 'text', type: 'string',},
  signType: {title: '签名类型',order: 16,view: 'list', type: 'string',dictCode: 'order_sign_type',},
  notifyUrl: {title: '异步通知地址',order: 17,view: 'text', type: 'string',},
  returnUrl: {title: '跳转通知地址',order: 18,view: 'text', type: 'string',},
  orderState: {title: '订单状态',order: 19,view: 'list', type: 'string',dictCode: 'order_state',},
  payDataType: {title: '支付数据类型',order: 20,view: 'text', type: 'string',},
  payData: {title: '发起支付数据',order: 21,view: 'text', type: 'string',},
  errCode: {title: '渠道错误码',order: 22,view: 'text', type: 'string',},
  errMsg: {title: '渠道错误描述',order: 23,view: 'text', type: 'string',},
  successTime: {title: '支付成功时间',order: 24,view: 'datetime', type: 'string',},
  bizType: {title: '业务类型',order: 25,view: 'list', type: 'string',dictCode: 'order_biz_type',},
  bizDate: {title: '业务数据',order: 26,view: 'text', type: 'string',},
};
